import {createApp} from 'vue'
import App from './App.vue'
//import Vue from 'vue'
import router from './router'
import dataV from '@jiaminghi/data-view'
import yourmilk from './yourmilk'
import * as echarts from 'echarts'

import config from "./utils/config.js"
import ws from './utils/ws.js'
import api from './api/index.js'

// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


// 引入全局css
import './assets/less/font.css';
router.beforeEach((to, from, next) => {
	to.meta.title && (document.title = to.meta.title);
	next()
});
const app = createApp(App)
app.use(dataV)
app.use(router)
app.use(yourmilk)
app.use(ElementPlus)
app.config.globalProperties.$echarts = echarts
app.config.globalProperties.$ws = ws;
app.config.globalProperties.$api = api;
app.config.globalProperties.$config = config;
app.mount("#app"); 

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

